package com.smh.aiagent.tools;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

import java.util.Scanner;

/**
 * @author shiminghui
 * @date 2025/6/8 20:07
 * @description: 一个像用户发问的工具
 */
public class AskHumanTool {

    private static final Scanner scanner = new Scanner(System.in);

    @Tool(description = "Ask for help from a human through this tool or need a human to respond to your inquiry")
    public String askHuman(@ToolParam(description = "Questions you want to ask humans") String question) {
        System.out.println("AI的提问: " + question);
        String answer = scanner.nextLine();

        return "The human answer: " + answer;
    }

}
